{% extends "base.html" %}

{% block content %}
<h2>Firma: {{ branch }}</h2>
<table>
    <tr>
        <td>Siedziba główna</td>
        {% ifequal branch.main_branch None %}
        <td>-</td>
        {% else %}
        <td><a href="/companies/show/{{ branch.main_branch.id }}/">{{ branch.main_branch }}</a></td>
        {% endifequal %}
    </tr>
    <tr><td>Ulica</td> <td>{{ branch.street }}</td></tr>
    <tr><td>Kod pocztowy</td> <td>{{ branch.postal_code }}</td></tr>
    <tr><td>Miasto</td> <td>{{ branch.city }}</td></tr>
    <tr>
        <td>Dodana do systemu przez</td>
        <td>{{ branch.created_by }}</td>
    </tr>
</table>
{% if user.teacher %}
<a href="/companies/edit/{{ branch.id }}/">Edytuj</a> |
<a href="/companies/seize/{{ branch.id }}/">Przejmij</a> |
{% else %}
    {% ifequal branch.created_by.id user.id %}
    <a href="/companies/edit/{{ branch.id }}/">Edytuj</a> |
    {% endifequal %}
{% endif %}
<a href="{{ return_url }}">Wróć</a>
{% endblock %}

